/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import eos.moe.dragoncore.api.PlayerModelLoader;
/*     */ import java.io.File;
/*     */ import java.io.IOException;
/*     */ import java.lang.reflect.Field;
/*     */ import java.net.MalformedURLException;
/*     */ import java.net.URL;
/*     */ import java.net.URLClassLoader;
/*     */ import java.util.List;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.entity.RenderLivingBase;
/*     */ import net.minecraft.client.renderer.entity.RenderPlayer;
/*     */ import net.minecraft.client.renderer.entity.layers.LayerRenderer;
/*     */ import net.minecraft.entity.SharedMonsterAttributes;
/*     */ import net.minecraft.entity.ai.attributes.BaseAttribute;
/*     */ import net.minecraft.entity.ai.attributes.RangedAttribute;
/*     */ import net.minecraftforge.common.MinecraftForge;
/*     */ import net.minecraftforge.fml.common.Loader;
/*     */ import net.minecraftforge.fml.common.Mod;
/*     */ import net.minecraftforge.fml.common.Mod.EventHandler;
/*     */ import net.minecraftforge.fml.common.Mod.Instance;
/*     */ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
/*     */ import net.minecraftforge.fml.relauncher.ReflectionHelper;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Mod(modid = "dragoncore", name = "Dragon Core", version = "2.0.0", acceptedMinecraftVersions = "required-after:forge@[14.23.3.2768,);", clientSideOnly = true)
/*     */ public class nm
/*     */ {
/*     */   public static final String r = "dragoncore";
/*     */   public static final String f = "Dragon Core";
/*     */   public static final String s = "2.0.0";
/*  55 */   public static ln m = new ln("dragoncore");
/*     */   
/*     */   @Instance
/*     */   public static nm l;
/*     */   
/*     */   public static File t;
/*     */   
/*     */   public static File d;
/*     */   public static YamlConfiguration z;
/*     */   public static boolean i;
/*     */   public static gh w;
/*     */   public static boolean q;
/*     */   public static boolean g;
/*     */   
/*     */   public nm() {
/*  70 */     Runtime.getRuntime().addShutdownHook(new eos/moe/dragoncore/qn(null));
/*     */   }
/*     */ 
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLPreInitializationEvent fMLPreInitializationEvent) {
/*  76 */     d = new File(fMLPreInitializationEvent.getSuggestedConfigurationFile().getParentFile().getParentFile(), "resourcepacks");
/*  77 */     d.mkdirs();
/*  78 */     t = new File(d, "DragonCore");
/*  79 */     t.mkdirs();
/*  80 */     (new File(t, "icon")).mkdirs();
/*  81 */     (new File(t, "models" + File.separator + "entities")).mkdirs();
/*  82 */     (new File(t, "models" + File.separator + "items")).mkdirs();
/*     */ 
/*     */     
/*  85 */     File file = new File(t, "config.yml");
/*  86 */     z = YamlConfiguration.loadConfiguration(new File(t, "config.yml"));
/*  87 */     if (!file.exists()) {
/*  88 */       z.set("EnableFontRenderer", Boolean.valueOf(true));
/*  89 */       z.set("BasicTransitionTime", Integer.valueOf(200));
/*  90 */       z.set("BasicTransitionTime", Integer.valueOf(200));
/*     */       try {
/*  92 */         z.save(file);
/*  93 */       } catch (IOException iOException) {
/*  94 */         iOException.printStackTrace();
/*     */       } 
/*     */     } 
/*  97 */     g = z.getBoolean("GlowBlock", false);
/*  98 */     tf.w = z.getInt("BasicTransitionTime", 200);
/*     */     
/* 100 */     mr.h();
/*     */     
/* 102 */     uy.v();
/* 103 */     MinecraftForge.EVENT_BUS.register(new sy());
/* 104 */     if (z.getBoolean("HideEntityModelKey")) {
/* 105 */       sy.z();
/*     */     }
/* 107 */     if (z.getBoolean("HidePlayerKey")) {
/* 108 */       sy.v();
/*     */     }
/* 110 */     if (z.getBoolean("RenderTest")) {
/* 111 */       mq.v();
/*     */     }
/*     */     try {
/* 114 */       Class.forName("net.optifine.gui.GuiChatOF");
/* 115 */       i = true;
/* 116 */     } catch (Exception exception) {
/* 117 */       i = false;
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLInitializationEvent fMLInitializationEvent) {
/* 126 */     hw.t();
/* 127 */     File file = new File(t, "prestrain");
/* 128 */     if (file.isDirectory()) {
/* 129 */       for (File file1 : file.listFiles()) {
/* 130 */         hw.v("prestrain/" + file1.getName());
/* 131 */         m.d("已完成预加载图片: " + file1.getName());
/*     */       } 
/*     */     }
/* 134 */     au.z.y();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLPostInitializationEvent fMLPostInitializationEvent) {
/* 142 */     MinecraftForge.EVENT_BUS.register(new tfa());
/*     */     
/* 144 */     MinecraftForge.EVENT_BUS.register(new kr());
/* 145 */     MinecraftForge.EVENT_BUS.register(new cz());
/* 146 */     MinecraftForge.EVENT_BUS.register(new aka());
/*     */     
/* 148 */     MinecraftForge.EVENT_BUS.register(new hq());
/* 149 */     MinecraftForge.EVENT_BUS.register(kq.q);
/*     */     
/* 151 */     or.h();
/* 152 */     if (z.getBoolean("EnableFontRenderer")) {
/* 153 */       wv.v();
/* 154 */       (Minecraft.func_71410_x()).field_71466_p = wv.v();
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLLoadCompleteEvent fMLLoadCompleteEvent) {
/* 163 */     BaseAttribute baseAttribute = (new RangedAttribute(null, "generic.maxHealth", 20.0D, 1.401298464324817E-45D, Double.MAX_VALUE)).func_111117_a("Max Health").func_111112_a(true);
/*     */     try {
/* 165 */       Field field1 = Field.class.getDeclaredField("modifiers");
/* 166 */       Field field2 = ReflectionHelper.findField(SharedMonsterAttributes.class, new String[] { "field_111267_a", "MAX_HEALTH" });
/* 167 */       field1.setAccessible(true);
/* 168 */       field1.setInt(field2, field2.getModifiers() & 0xFFFFFFEF);
/* 169 */       field2.set(null, baseAttribute);
/* 170 */     } catch (NoSuchFieldException|IllegalAccessException reflectiveOperationException) {
/* 171 */       reflectiveOperationException.printStackTrace();
/*     */     } 
/*     */ 
/*     */     
/* 175 */     File file = new File((Minecraft.func_71410_x()).field_71412_D, "config" + File.separator + "DragonCore.cfg");
/* 176 */     if (file.exists()) {
/*     */       try {
/* 178 */         URLClassLoader uRLClassLoader = new URLClassLoader(new URL[] { file.toURI().toURL() }, getClass().getClassLoader());
/* 179 */         Class<?> clazz = uRLClassLoader.loadClass("dragoncore.DragonCore");
/* 180 */         Class<? extends gh> clazz1 = clazz.asSubclass(gh.class);
/* 181 */         w = clazz1.newInstance();
/* 182 */       } catch (MalformedURLException|ClassNotFoundException|InstantiationException|IllegalAccessException exception) {
/*     */         
/* 184 */         exception.printStackTrace();
/*     */       } 
/*     */     }
/* 187 */     q = Loader.isModLoaded("dragonarmourers");
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLServerStartingEvent fMLServerStartingEvent) {}
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v() {
/* 201 */     for (RenderPlayer a : Minecraft.func_71410_x().func_175598_ae().getSkinMap().values()) {
/* 202 */       List list = (List)ReflectionHelper.getPrivateValue(RenderLivingBase.class, a, new String[] { "layerRenderers", "field_177097_h" });
/*     */       
/* 204 */       for (LayerRenderer layerRenderer : list) {
/* 205 */         if (layerRenderer instanceof cy) {
/*     */           return;
/*     */         }
/*     */       } 
/* 209 */       a.func_177094_a(new cy(a));
/*     */     } 
/*     */   }
/*     */   
/*     */   private static class eos/moe/dragoncore/qn
/*     */     extends Thread
/*     */   {
/*     */     public void run() {
/* 217 */       xea.m.z();
/* 218 */       tja.h();
/* 219 */       tr.h();
/* 220 */       hw.z();
/* 221 */       au.z.h();
/* 222 */       zg.g.shutdownNow();
/* 223 */       PlayerModelLoader.shutdown();
/*     */     }
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\nm.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */